# import numpy as np
# arr = np.random.randint(1, 100, size=(3,4))
# print('3x4的原数组: \n', arr)
# print('转制后的4x3的数组: \n', arr.T)
# print('变形后2x6的数组: \n', arr.reshape(2, 6))



import numpy as np
arr1 = np.random.randint(1, 10, size=(3, 3))
print('随机生成的二维整数数组arr1: \n', arr1)
arr2 = np.random.randint(1, 10, size=3)
print('随机生成的一维整数数组arr2: \n', arr2)
arr3 = np.random.rand(3, 3) * 10
print('随机生成的二维小数数组arr3: \n', arr3)
print('arr1和arr2相加: \n', np.add(arr1, arr2))
print('arr1和arr3相乘: \n', np.multiply(arr1, arr3))
print('以arr1为底数， arr2为指数的幂: \n', np.power(arr1, arr2, dtype='int64'))
print('arr1的倒数: \n', np.reciprocal(arr1, dtype='float'))
print('aee3 四舍五入，小数点后保留一位: \n', np.around(arr3, decimals=1))
print('arr1的余弦值: \n', np.cos(arr1 * np.pi / 180))